home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Sys::Syslog.Z / Sys::Syslog
Encoding:
Text File  |  1998-10-28  |  4.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))  22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))    SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       Sys::Syslog, openlog,    closelog, setlogmask, syslog - Perl
  10.       interface to the UNIX    _s_y_s_l_o_g(3) calls
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           use Sys::Syslog;                # all except setlogsock, or:
  14.           use Sys::Syslog qw(:DEFAULT setlogsock);    # default set, plus setlogsock
  15.  
  16.           setlogsock $sock_type;
  17.           openlog $ident, $logopt, $facility;
  18.           syslog $priority,    $format, @args;
  19.           $oldmask = setlogmask $mask_priority;
  20.           closelog;
  21.  
  22.  
  23.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.       Sys::Syslog is an interface to the UNIX syslog(3) program.
  25.       Call syslog()    with a string priority and a list of printf()
  26.       args just like syslog(3).
  27.  
  28.       Syslog provides the functions:
  29.  
  30.       openlog $ident, $logopt, $facility
  31.            $_i_d_e_n_t is prepended to every message.  $_l_o_g_o_p_t contains
  32.            zero or more of the words _p_i_d, _n_d_e_l_a_y, _c_o_n_s, _n_o_w_a_i_t.
  33.            $_f_a_c_i_l_i_t_y specifies the part of the system
  34.  
  35.       syslog $priority, $format, @args
  36.            If $_p_r_i_o_r_i_t_y permits, logs ($_f_o_r_m_a_t, @_a_r_g_s) printed as
  37.            by printf(3V), with the addition    that %_m    is replaced
  38.            with "$!" (the latest error message).
  39.  
  40.       setlogmask $mask_priority
  41.            Sets log    mask $_m_a_s_k__p_r_i_o_r_i_t_y and    returns    the old    mask.
  42.  
  43.       setlogsock $sock_type    (added in 5.004_02)
  44.            Sets the    socket type to be used for the next call to
  45.            openlog() or syslog() and returns TRUE on success,
  46.            undef on    failure.
  47.  
  48.            A value of 'unix' will connect to the UNIX domain
  49.            socket returned by _PATH_LOG in _s_y_s_l_o_g._p_h.  A value of
  50.            'inet' will connect to an INET socket returned by
  51.            _g_e_t_s_e_r_v_b_y_n_a_m_e().     Any other value croaks.
  52.  
  53.            The default is for the INET socket to be    used.
  54.  
  55.       closelog
  56.            Closes the log file.
  57.  
  58.       Note that openlog now    takes three arguments, just like
  59.       openlog(3).
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))  22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))    SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))
  71.  
  72.  
  73.  
  74.      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  75.           openlog($program,    'cons,pid', 'user');
  76.           syslog('info', 'this is another test');
  77.           syslog('mail|warning', 'this is a    better test: %d', time);
  78.           closelog();
  79.  
  80.           syslog('debug', 'this is the last    test');
  81.  
  82.           setlogsock('unix');
  83.           openlog("$program    $$", 'ndelay', 'user');
  84.           syslog('notice', 'fooprogram: this is really done');
  85.  
  86.           setlogsock('inet');
  87.           $! = 55;
  88.           syslog('info', 'problem was %m');    # %m ==    $! in syslog(3)
  89.  
  90.  
  91.      DDDDEEEEPPPPEEEENNNNDDDDEEEENNNNCCCCIIIIEEEESSSS
  92.       SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg needs _s_y_s_l_o_g._p_h, which can be created with h2ph.
  93.  
  94.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  95.       the _s_y_s_l_o_g(_3)    manpage
  96.  
  97.      AAAAUUUUTTTTHHHHOOOORRRR
  98.       Tom Christiansen <_t_c_h_r_i_s_t@_p_e_r_l._c_o_m> and Larry    Wall
  99.       <_l_a_r_r_y@_w_a_l_l._o_r_g>.  UNIX domain sockets added by Sean
  100.       Robinson <_r_o_b_i_n_s_o_n__s@_s_c._m_a_r_i_c_o_p_a._e_d_u>    with support from Tim
  101.       Bunce    <Tim.Bunce@ig.co.uk> and the perl5-porters mailing
  102.       list.
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.